<?php
class PasswordrecoveryForm extends Zend_Form
{
    public function init()
    {           
        $username = $this->createElement('text','username');
        $username->setLabel('Username : *')
        	->setRequired(true)
            ->addValidator('NotEmpty')
            // The username has to be in the database
            ->addValidator(new Zend_Validate_Db_RecordExists('Person', 'username'))
            ->addValidator(new Zend_Validate_StringLength(0, 45));
                
        $sendemail = $this->createElement('submit','sendemail');
        $sendemail->setLabel('Send new password')->setIgnore(true);
        
        // Add the elements to the form
        $this->addElements(array(
                        $username,
                        $sendemail
        ));
    }
}

